package com.oma.testcase;
import java.util.concurrent.TimeUnit;


import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
//import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.Select;

public class MedSec {

	public void select(WebDriver driver, String dec){
		Select dept = new Select(driver.findElement(By.xpath("//select[@id='selectDept']")));
		Select section = new Select(driver.findElement(By.xpath("//select[@id='sectionChief']")));
		String pos ="";
		//Select Section and Unit head
		if(dec == "section"){
			
			dept.selectByVisibleText("DEPARTMENT 1");
			section.selectByVisibleText("Section Head 1");
			pos = "Section Head";
		} else {
			dept.selectByVisibleText("DEPARTMENT 1");
			pos = "Unit Head";
		}
		
		driver.findElement(By.xpath("//button[@id='submitApproval']")).click();
		driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
		System.out.println("Forwarded to :" +pos);
	}
	
	
}



